#include<stdio.h>
int main()
{
	double a, b;
	scanf("%lf", &a);
	if(a>=5000)
		b=a*0.8;
	else if(a>=3000)
		b=a*0.85;
	else if(a>=1000)
		b=a*0.9;
	else if(a>=500)
		b=a*0.95;
	else
		b=a;
	
	printf("%.2f", b);
	return 0;
}
